/*
 * FileName: InformationServiceImpl.java
 *
 * Company: 
 * Copyright 2011-2012 (C) Ultrapower Software CO., LTD. All Rights Reserved.
 */
package com.jmeurope.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.jmeurope.dao.InformationDao;
import com.jmeurope.model.Information;
import com.jmeurope.service.InformationService;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author wangwei  leo_java@163.com
 * @version 1.0

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * Jan 2, 2012 11:16:21 PM          wangwei        1.0         To create
 * </p>
 *
 * @since 
 * @see     
 */
@Service
@Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class)
@SuppressWarnings("unchecked")
public class InformationServiceImpl implements InformationService {
	@Autowired
	private InformationDao informationDao;
	@Override
	public Integer addInformation(Information information) throws Exception {
		// TODO Auto-generated method stub
		return informationDao.insert(information);
	}

	@Override
	public void deleteInformation(Integer id) throws Exception {
		informationDao.delete(id);
	}

	@Override
	public List<Information> getAllInformations() throws Exception {
		return informationDao.findAll();
	}
	@Override
	public Information getInformationById(Integer id) throws Exception {
		// TODO Auto-generated method stub
		return informationDao.find(id);
	}
	@Override
	public List<Information> getInformationsByStatus(Map map) throws Exception {
		// TODO Auto-generated method stub
		return informationDao.getInformationsByStatus(map);
	}

	@Override
	public List<Information> getInformationsByStatusAndBussinessId(Map map)
			throws Exception {
		return informationDao.getInformationsByStattusAndBussinessId(map);
	}

	@Override
	public List<Information> getInformationsByStatusAndupdateDate(Map map)
			throws Exception {
		return informationDao.getInformationsByStattusAndUpdateDate(map);
	}

	@Override
	public void updateInformation(Information project) throws Exception {
		informationDao.update(project);
	}

}
